Skip to content

fix(js-dependency-audit): drop invalid --groups flag for yarn-classic#171

Merged
marians merged 1 commit into
mainfrom
fix/yarn-classic-audit-groups
May 13, 2026
Merged

fix(js-dependency-audit): drop invalid --groups flag for yarn-classic#171
marians merged 1 commit into
mainfrom
fix/yarn-classic-audit-groups

Conversation

@marians
Copy link
Copy Markdown
Member

@marians marians commented May 13, 2026

Summary

yarn audit --json --groups dependencies,devDependencies doesn't work for yarn v1: --groups is a space-separated multi-arg flag, so the comma-joined form is parsed as a single literal group name that doesn't exist, and the audit returns 0 advisories with totalDependencies: 0.

Dropping the flag uses yarn's default groups (devDependencies,dependencies,optionalDependencies), matching the original intent (audit prod + dev dependencies) and aligning with what npm, pnpm, and yarn-berry already do here.

How it surfaced

giantswarm/happa#4746 is a Renovate PR upgrading mermaid to fix several CVEs. The audit comment showed:

0 added · 0 removed · 0 total

…with no "Full current vulnerability list" details block. Both audit runs (head and base) produced empty findings, so the delta was 0/0/0 and the renderer correctly skipped the empty list.

Verification on happa (yarn-classic)

Invocation advisories totalDependencies
yarn audit --json --groups dependencies,devDependencies (before) 0 0
yarn audit --json --groups dependencies devDependencies (space, valid) 29 612
yarn audit --json (default, this PR) 342 3194

Default groups also include optionalDependencies, which is consistent with what npm audit reports.

Test plan

  • Re-run the workflow on giantswarm/happa#4746 (or any yarn-classic caller) and confirm the comment now reports a non-zero current total and renders the details block.
  • Spot-check that npm / pnpm / yarn-berry callers are unaffected.

`yarn audit --json --groups dependencies,devDependencies` doesn't work
for yarn v1: `--groups` is a space-separated multi-arg flag, so the
comma-joined form is parsed as a single literal group name that doesn't
exist, and the audit returns 0 advisories with `totalDependencies: 0`.

Dropping the flag uses yarn's default groups
(`devDependencies,dependencies,optionalDependencies`), which matches the
original intent (audit prod + dev dependencies) and aligns with what
npm/pnpm/yarn-berry already do.

Verified on giantswarm/happa (yarn-classic):
- Before (broken): 0 advisories, 0 deps
- After (default): 342 advisories, 3194 deps

Surfaced via happa#4746, whose audit comment showed
`0 added · 0 removed · 0 total` and no current-vulnerabilities details
block.
@marians marians requested a review from a team as a code owner May 13, 2026 10:24
@marians marians merged commit 462493c into main May 13, 2026
1 check passed
@marians marians deleted the fix/yarn-classic-audit-groups branch May 13, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants